<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="zh-CN">
<head>
<title>求二维数组的平均值</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="description" content="" />
<meta name="keywords" content="" />
<script type="text/javascript">
    var arr1 = ['23','34','21','17'];
    var arr2 = ['18','32','61','7'];
    var arr3= ['33','24','11','19'];
    var arr = [arr1,arr2,arr3];
    var s = 0;
    var n = 0;
    for(var i=0; i<arr.length; i++) {
        for(var j=0; j<arr[i].length; j++) {
            s += parseInt(arr[i][j]);
            n++;
        }
    }
    document.write('平均值为：' + s/n);
</script>

<style type="text/css">
</style>
</head>
    <body>
    </body>
</html>